Conversation
ralphbean
reviewed
Oct 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We're seeing some odd behavior for certain Issue assignees. The Jira lookup based on the RH email address returned by the LDAP search is returning multiple assignees in these cases. The
sync2jiracode then arbitrarily selects the first one, since they are all supposed to match the email address. But, the selected user doesn't actually match the upstream assignee, and it seems to be the same individual in all the cases...so, it looks like Jira is returning all possible assignees -- not just the ones with matching email addresses -- and the list is probably in sorted order, and it results in a unique hit for all searches.The principal purpose of this PR is to make two changes: to enhance the logging so that we can get better insight into what's actually happening, and to provide some validation of the Jira response.
The code which matches the up- and downstream assignees is reordered slightly, so that it checks for a unique match before checking for multiple matches. In the event that multiple possible assignees are returned, the code searches for one which matches the target email address. Since all the returned assignees should match the target, this code should simply select the first one; however, if Jira is misbehaving as I expect, this will ensure that we don't try to assign the downstream issue to a non-match. This change also includes enhancements to the logging which, hopefully, will be illuminating. And, because of this additional checking, we need additional support from the mocking in the unit tests.
In addition, this PR reworks the LDAP lookup's error handling, so that, hopefully, we'll be properly notified of real errors without false positives for "normal" cases (which will "quiet" the logging a bit).
ERROR's; and, now, searches which are otherwise successful but which return no result will be logged asINFO's.DEBUG-level during production operation).